package com.timk.goserver.client.services;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.timk.goserver.client.model.ClientUserInfo;

/** */
public interface UserServiceAsync {
	/**
	 * Returns the current user
	 * @param callback returns the user
	 */
	void getCurrentUser(AsyncCallback callback);
	
	/**
	 * Returns a user by username
	 * @param username
	 * @param callback returns ClientUserInfo
	 */
	void getUser(String username, AsyncCallback callback);
	
	/**
	 * Sets the current user's information
	 * @param info
	 * @param callback the callback
	 */
	void setUserInfo(ClientUserInfo info, AsyncCallback callback);
	
	/**
	 * Changes the current user's password
	 * @param oldPassword
	 * @param newPassword
	 * @param callback returns integer error code
	 */
	void changePassword(String oldPassword, String newPassword, AsyncCallback callback);

	/**
	 * Returns a list of users matching the criteria
	 * @param firstResult index of first result
	 * @param maxResults number of results to return
	 * @param substring substring to match against usernames
	 * @param callback List&lt;ClientUserInfo&gt;
	 */
	void getUsers(int firstResult, int maxResults, String substring,
			AsyncCallback callback);
}
